﻿using Coder.Beer.Robot.Api.ApplicationModel;
using Coder.Beer.Robot.Api.Repository.Model;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading.Tasks;

namespace Coder.Beer.Robot.Api.Repository
{
    public class BeerDbContext : DbContext
    {
        public BeerDbContext([NotNullAttribute] DbContextOptions options) : base(options)
        {
        }

        protected BeerDbContext()
        {
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (optionsBuilder.IsConfigured)
            {
                return;
            }
            optionsBuilder.UseNpgsql("server=192.168.50.54;database=beer_user_connected;user id=postgres;password=12345678");
        }

        public virtual DbSet<UserConnected> UserConnecteds { get; set; }
        public virtual DbSet<NodeBBTopic> NodeBBTopics { get; set; }

        public virtual DbSet<NodeBBPost> NodeBBPosts { get; set; }
    }
}
